﻿using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using BBICMS.Model;

namespace BBICMS.Repository.Configuration
{
    public class BSizeMap : EntityTypeConfiguration<BSize>
    {
        public BSizeMap()
        {
            this.HasKey(c => c.Id);
            this.Property(b => b.Id)
              .HasColumnName("Id")
              .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            this.ToTable("BSizes");

            this.Property(p => p.Value).IsRequired();
            this.Property(p => p.Importance).IsRequired();
            this.Property(p => p.Active).IsRequired();
            this.Property(p => p.AddedDate).IsRequired().HasColumnType("datetime");
            this.Property(p => p.AddedBy).HasMaxLength(50);
            this.Property(p => p.UpdatedDate).IsOptional().HasColumnType("datetime");
            this.Property(p => p.UpdatedBy).IsOptional().HasMaxLength(50);


           //this.HasMany(c => c.ProductCategoryLangs)
           // .WithOptional()
           // .WillCascadeOnDelete(true);

        }
    }
}
